<?php

/**
 * Concepto form base class.
 *
 * @method Concepto getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseConceptoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'     => new sfWidgetFormInputHidden(),
      'nombre' => new sfWidgetFormInputText(),
      'tipo'   => new sfWidgetFormChoice(array('choices' => array('FIJO' => 'FIJO', 'VARIABLE' => 'VARIABLE'))),
      'cuenta' => new sfWidgetFormChoice(array('choices' => array('CREDITO' => 'CREDITO', 'DEBITO' => 'DEBITO'))),
      'valor'  => new sfWidgetFormInputText(),
      'activo' => new sfWidgetFormChoice(array('choices' => array('SI' => 'SI', 'NO' => 'NO'))),
      'codigo' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'nombre' => new sfValidatorString(array('max_length' => 30)),
      'tipo'   => new sfValidatorChoice(array('choices' => array(0 => 'FIJO', 1 => 'VARIABLE'), 'required' => false)),
      'cuenta' => new sfValidatorChoice(array('choices' => array(0 => 'CREDITO', 1 => 'DEBITO'), 'required' => false)),
      'valor'  => new sfValidatorNumber(),
      'activo' => new sfValidatorChoice(array('choices' => array(0 => 'SI', 1 => 'NO'), 'required' => false)),
      'codigo' => new sfValidatorString(array('max_length' => 20)),
    ));

    $this->widgetSchema->setNameFormat('concepto[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Concepto';
  }

}
